import { _decorator, Component, Node } from 'cc';
import { BaseManager } from './BaseManager';
import { PanelName } from './ResourceManager';
import { TipPanel } from '../panels/TipPanel';
import { _resource } from '../Main';
const { ccclass, property } = _decorator;

@ccclass('TipManager')
export class TipManager extends BaseManager {

    managerName: string = '提示管理器'

    init(): void {
        
    }

    tip(tip: string, last: number = 1, onOpen?: () => void, onClose?: () => void) {
        let tp = _resource.openPanel(_resource.getPanelPrefab(PanelName.TipPanel)).getComponent(TipPanel)
        if (tp) {
            tp.showTip(tip, last, onOpen, onClose)
        }
    }
}


